<?php
/**
 * Author:xsc
 * Time:2023/9/4 14:43
 */

namespace App\Http\Controllers\Common;

use App\Http\Controllers\BaseController;
use App\Params\Common\CouponParams;
use App\Params\Common\CouponStockParam;
use App\Service\Common\SpecialService;

class CouponController extends BaseController
{

    /**
     * 卡券列表
     * @return \Illuminate\Http\JsonResponse
     * @throws \App\Exceptions\BusinessException
     * Author:xsc
     * Time:2023/9/4 19:43
     */
    public function list()
    {
        $params = CouponParams::create();
        $data = SpecialService::getInstance()->couponList($params);
        return $this->success($data);
    }

    /**
     * 卡券库存
     * @return \Illuminate\Http\JsonResponse
     * @throws \App\Exceptions\BusinessException
     * Author:xsc
     * Time:2023/9/14 17:08
     */
    public function stock()
    {
        $params = CouponStockParam::create();
        $data = SpecialService::getInstance()->couponStock($params);
        return $this->success($data);
    }

}
